<?php

namespace App\Http\Middleware;

use Closure;

class LoginMiddleware
{
     /**
     * 运行请求过滤器。
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return boolean
     */
    public function handle($request, Closure $next)
    {
       if ($request->session()->has('uid')) {
  
            return $next($request);
        }

            return redirect('/admin');
    }
}
